package com.yh.homestay.service.impl;

import com.yh.homestay.dao.UserStaffMapper;
import com.yh.homestay.pojo.UserStaff;
import com.yh.homestay.service.UserStaffServiceG;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName UserStaffServiceImpl
 * @Description TODO
 * @Author GCL
 * @Date 2020/1/6 12:07
 */
@Service
public class UserStaffServiceImplG implements UserStaffServiceG {

    private Log logger= LogFactory.getLog(UserStaffServiceImplG.class);

    @Autowired
    private UserStaffMapper userStaffMapper;

    /**
    * @Date: 2020/1/7 12:07
    * @Description: 根据用户工号查询用户是否存在
    * @param staffId 
    * @return: com.yh.homestay.pojo.UserStaff
    */ 
    @Override
    public UserStaff selectOne(Integer staffId) {
        try{
            return userStaffMapper.selectByPrimaryKey(staffId);
        }catch (Exception e){
            logger.debug(e);
            return null;
        }
    }
}
